gdk: Pass hardware ID on gdk_device_tool_new()
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 4 Aug 2016 16:52:51 +0000 (18:52 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 23 Aug 2016 19:01:44 +0000 (21:01 +0200)
And implement this on wayland, where this information is already obtained.

https://bugzilla.gnome.org/show_bug.cgi?id=770026

gdk/gdkdevicetool.c
gdk/gdkdevicetoolprivate.h
gdk/wayland/gdkdevice-wayland.c
gdk/x11/gdkdevicemanager-xi2.c

index d632504fa4994cddb919ad719475a0d4064a8bf5..1b1cd38606353724248a236f771236988574ec36 100644 (file)
@@ -137,11 +137,13 @@ gdk_device_tool_init (GdkDeviceTool *tool)
 
 GdkDeviceTool *
 gdk_device_tool_new (guint64           serial,
+                     guint64           hw_id,
                      GdkDeviceToolType type,
                      GdkAxisFlags      tool_axes)
 {
   return g_object_new (GDK_TYPE_DEVICE_TOOL,
                        "serial", serial,
+                       "hardware-id", hw_id,
                        "tool-type", type,
                        "axes", tool_axes,
                        NULL);
index ff9a40403e2607e3cb4b0e3356f108c93df1df5c..63d06366c310b2fff666dbba1e6424d1f7430840 100644 (file)
@@ -28,6 +28,7 @@ struct _GdkDeviceTool
 {
   GObject parent_instance;
   guint64 serial;
+  guint64 hw_id;
   GdkDeviceToolType type;
   GdkAxisFlags tool_axes;
 };
@@ -38,6 +39,7 @@ struct _GdkDeviceToolClass
 };
 
 GdkDeviceTool *gdk_device_tool_new    (guint64            serial,
+                                       guint64            hw_id,
                                        GdkDeviceToolType  type,
                                        GdkAxisFlags       tool_axes);
 
index c13818ec75513ab7df2ecd4c6ee54e026d56b17a..315ebdc39ad1d0757562dc92bb181f28f640e77a 100644 (file)
@@ -3105,7 +3105,9 @@ tablet_tool_handle_done (void                      *data,
 {
   GdkWaylandTabletToolData *tool = data;
 
-  tool->tool = gdk_device_tool_new (tool->hardware_serial, tool->type, tool->axes);
+  tool->tool = gdk_device_tool_new (tool->hardware_serial,
+                                    tool->hardware_id_wacom,
+                                    tool->type, tool->axes);
   gdk_seat_tool_added (tool->seat, tool->tool);
 }
 
index 61458772b1d3322cb544947f1b261600329c5f41..2fd413c08202f3d91552f905a93564ee0d879d44 100644 (file)
@@ -1030,7 +1030,7 @@ handle_property_change (GdkX11DeviceManagerXI2 *device_manager,
 
           if (!tool && serial_id > 0)
             {
-              tool = gdk_device_tool_new (serial_id,
+              tool = gdk_device_tool_new (serial_id, 0,
                                           GDK_DEVICE_TOOL_TYPE_UNKNOWN, 0);
               gdk_seat_default_add_tool (GDK_SEAT_DEFAULT (seat), tool);
             }